<?php $this->renderPartial('//common/header'); ?>
<!-- CONTENT CONTAINER -->
<div class="container">
	<ul class="breadcrumb">
		<li><a href="<?php echo PIUrl::createUrl('/home/');?>"><?php echo translate("Trang chủ"); ?></a></li>
		<li><span><?php echo translate("Biểu mẫu"); ?></span></li>
	</ul>
	<div class="content-container row">
		<!-- MAIN CONTENT -->
		<div class="col-md-8 main-content">
			<!-- TABLE HỢP ĐỒNG CHUYỂN NHƯỢNG -->
			<?php if(!empty($arrCategory)){ $i = 0; ?>
				<?php foreach($arrCategory as $rowCategory){ $i++; ?>
					<table class="block table-file <?php echo ($i != 1) ? "table-next" : ""; ?>">
						<thead>
							<tr>
								<th id="<?php echo $rowCategory->id; ?>" class="title title-bd"><span><?php echo $rowCategory->name; ?></span></th>
								<th class="title title-bd"><span><?php echo translate("Kích thước file"); ?></span></th>
								<th class="title title-bd"><span><?php echo translate("Loại file"); ?></span></th>
								<th class="title title-bd"><span><?php echo translate("Tải về"); ?></span></th>
							</tr>
						</thead>
						<tbody>
						<?php if(!empty($arrDocument)){ ?>
								<?php foreach($arrDocument as $rowDocument){ ?>
									<?php if($rowDocument->category_document_id == $rowCategory->id){ ?>
									<tr>
										<td><a href="javascript:void(0)"><?php echo $rowDocument->name; ?></a></td>
										<td><a href="javascript:void(0)"><?php echo round($rowDocument->size/1024)." KB"; ?></a></td>
										<td><a href="javascript:void(0)"><i class="icon <?php 
											if($rowDocument->type=="doc" || $rowDocument->type == 'docx') echo 'icon-word';
											else{
												if($rowDocument->type == 'pdf') echo 'icon-pdf';
												else echo 'icon-excel';
											}
											
										?>"></i></a></td>
										<td><a href="<?php echo PIUrl::createUrl('/home/download/', array('name' => $rowDocument->id));?>"><i class="icon icon-file"></i></a></td>
									</tr>
									<?php } ?>
								<?php } ?>
						<?php } ?>
						</tbody>
					</table>
				<?php } ?>
			<?php }else{ echo translate("Không tìm thấy nội dung!"); } ?>
		</div>
		<!-- SIDEBAR -->
		<div class="col-md-4 sidebar">
			<!-- BLOCK HỎI ĐÁP -->
			<?php $this->widget("application.components.widgetQuestionAnswers"); ?>
			<!-- BLOCK TIN TỨC NỔI BẬT -->
			<?php $this->widget("application.components.widgetNews"); ?>
		</div>
	</div>
</div>

<!-- FULL BLOCK HÌNH ẢNH HOẠT ĐỘNG -->
<?php $this->widget("application.components.widgetImages"); ?>

<!-- FULL BLOCK HỖ TRỢ LIÊN KẾT -->
<?php $this->widget("application.components.widgetLinkSupport"); ?>

<div id="push"> </div>
</div>
<?php $this->renderPartial('//common/footer'); ?>
<style>
i.icon-excel{
	background: url("<?php echo Yii::app()->theme->baseUrl;?>/img/front/icon/icon-excel.png") no-repeat;
	width: 15px; height: 18px;
}
i.icon-pdf{
	background: url("<?php echo Yii::app()->theme->baseUrl;?>/img/front/icon/icon-pdf.png") no-repeat;
	width: 15px; height: 18px;
}
</style>
<script>
$(document).ready(function(){
	$(".selected a").css("background-color", "#073B66");
	
	var focusElement = $($(location).attr('hash'));
    ScrollToTop(focusElement, function() { focusElement.focus(); });  

	function ScrollToTop(el, callback) { 
		$('html, body').animate({ scrollTop: $(el).offset().top - 50 }, 'slow', callback);
	}; 
	
});
</script>